<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::get('/user', function (Request $request) {
    return $request->user();
})->middleware('auth:api');
$api = app('Dingo\Api\Routing\Router');
$api->version(['v1','v2'],function($api){
    $api->group(['namespace'=>'App\Api\hvish\v1','prefix'=>'v1'],function($api){
        $api->get('tests','StudentController@test');
        $api->get('redisT','UserController@redisT');
        $api->get('getRoom','UserController@getRoom');
        $api->post('reg','UserController@reg');
        $api->post('shiwu','UserController@shiwu');
    });
    $api->group(['namespace'=>'App\Api\hvish\v2','prefix'=>'v2'],function($api){
        $api->get('tests','StudentController@test');
    });

});

